#include <iostream>

using namespace std;

void printa(const int* a, int len) {
	for(int i = 0; i < len; i++) {
		cout << a[i] << " ";
	}
	cout << endl;
}

void sorta(int* a, int len) {
	for(int i = len-1; i > 0; i--) {
		for(int j = 0; j < i; j++) {
			if(a[j] > a[j+1]) {
				int tp = a[j];
				a[j] = a[j+1];
				a[j+1] = tp;
			}
		}
	}
}

int main()
{
	
	int a[] = {1, -2, 3, -4, 5, -6, 7, -8, 9, -10};
	int len = sizeof(a) / sizeof(a[0]);
	
	printa(a, len);
	sorta(a, len);
	printa(a, len);
	
	return 0;
}